home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) Mar, 1986 UMMC. All rights reserved
-
- Filename: mkmxa.c
-
- Abstract: This module contains the code to construct the matrices used to transform between
- the AP and LAT image coordinate systems.
-
- Environment: UM/CLIP
-
- Revision History:
- Rev # Date Auth Reason
- ----- --------- ----- ----------------------------------
- 0.0 18-mar-86 js original implementation
- 0.1 28-apr-86 js converted to double precision
-
- ----------------------------------------------------------------------------------------------------------------------------
- NAME:
-
- mkmxii - make coordinate transform matrices (AP/LAT image planes)
-
- SYNOPSIS:
-
- ERRCODE mkmxii (p2a, a2p, p2l, l2p, a2l, l2a)
-
- DOUBLE p2a[9]; array containing 'patient to AP' transform matrix
- DOUBLE a2p[9]; array containing 'AP to patient' transform matrix
- DOUBLE p2l[9]; array containing 'patient to LAT' transform matrix
- DOUBLE l2p[9]; array containing 'LAT to patient' transform matrix
- DOUBLE a2l[9]; array for return of AP to LAT transform matrix
- DOUBLE l2a[9]; array for return of LAT to AP transform matrix
-
- MODIFIED ARGUMENTS:
-
- a2l and l2a will contain the transform matrices generated from the input matricies
-
- FUNCTION:
-
- Matrix methods are used in order to implement transformations between the coordinate
- systems subtended by the AP image plane and the patient. It is the function of this
- routine to construct the required matrices based on the angulation of the C-arm as specified
- by the matrices calculated in mkmxa and mkmxl. The matrices are the result of matrix multiplication
- of the 'stepping stone' matricies as follows:
-
- [a2l] = [a2p] * [p2l]; [l2a] = [l2p] * [p2a];
-
- PROGRAMMING NOTES:
-
- The elements of the matrices will be stored as sequential rows in the array.
-
- EXAMPLES:
-
- =========================================================================*/
-
- #include "clipinclude.h"
-
- ERRCODE mkmxii (p2a, a2p, p2l, l2p, a2l, l2a)
-
- DOUBLE p2a[9]; /* array containing 'patient to AP' transform matrix */
- DOUBLE a2p[9]; /* array containing 'AP to patient' transform matrix */
- DOUBLE p2l[9]; /* array containing 'patient to LAT' transform matrix */
- DOUBLE l2p[9]; /* array containing 'LAT to patient' transform matrix */
- DOUBLE a2l[9]; /* array for return of AP to LAT transform matrix */
- DOUBLE l2a[9]; /* array for return of LAT to AP transform matrix */
-
- {
-
- INT rows = 3; /* rows in matrices */
- INT cols = 3; /* collumns in matrices */
- ERRCODE erret = OK; /* error code */
-
- ERRCODE mxmul (); /* matrix multiplication routine */
-
- /* construct matrices */
-
- erret = mxmul ( a2p, rows, cols, p2l, rows, cols, a2l);
-
- if (erret == OK)
- erret = mxmul ( l2p, rows, cols, p2a, rows, cols, l2a);
-
- /* all done */
-
- return (erret);
-
- }